package com.acme.bankapp.domain;

import java.io.Serializable;

/**
 * Distinguishes men from women.
 */
public enum Gender implements Serializable {
	MALE("Mr."), FEMALE("Ms.");
	  
	private String stringRepresentation;
	 
	public static Gender valueOf(char c) {
		switch (c) {
		case 'm':
			return Gender.MALE;
		case 'f':
			return Gender.FEMALE;
		default: return null;
		}		
	}

	private Gender(String stringRepresentation) {
		this.stringRepresentation = stringRepresentation;
	}
  
	/**
	 * @return "Mr." for Males, "Ms." for Females. 
	 */
	@Override
	public String toString() {
		return stringRepresentation;
	}
	  
}
